<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Anunciante</title>
</head>
<body>
<f:view>
    <h2> Local do Anunciante</h2>
    <h:form>
    <h:commandLink action="novoAnuncio"><h:outputText value="(+) Criar Novo Anuncio"></h:outputText></h:commandLink>
    </h:form>
    <h:dataTable border="1" value="#{principal.usuario.anuncios}" var="anuncio">
    <h:column id="anuncio">
    <f:facet name="header">
					<h:outputText value="Anúncio"></h:outputText>
				</f:facet>
    <h:outputText value="#{anuncio.resumo}"></h:outputText> 
    </h:column>
    <h:column id="detalhes">
    <f:facet name="header">
					<h:outputText value="Detalhes"></h:outputText>
				</f:facet>
    <h:outputText value="#{anuncio.detalhes}"></h:outputText> 
    </h:column>
    <h:column id="numcomentarios">
    <f:facet name="header">
					<h:outputText value="Números Comentários"></h:outputText>
				</f:facet>
    <h:outputText value="#{anuncio.quantidadeComentarios}"></h:outputText> 
    </h:column>
    <h:column id="acoes" >
				<f:facet name="header">
					<h:outputText value="Ações"></h:outputText>
				</f:facet>
				<h:form>
					<h:commandLink  value="Editar" rendered="true" action="#{usuario.editarAnuncio}" >
					<f:setPropertyActionListener value="#{anuncio.codigo}" target="#{usuario.idAnuncio}"/></h:commandLink>
					<h:outputText value=" | "></h:outputText>
<%-- 					<h:commandLink action="#{principal.excluirAnuncio }" value="Deletar" rendered="true"   ></h:commandLink> --%>
<%-- 					<h:outputText value=" | "></h:outputText> --%>
					<h:commandLink action="responder" value="Responder" rendered="true"></h:commandLink>
				</h:form>
			</h:column>
    </h:dataTable>
    
</f:view>
</body>
</html>